<?php get_header(); ?>
<!--Mirages主题-->
<!--博文详情页-->

<!-- 复制内容弹窗版权提醒 -->
<script type="text/javascript">
    document.body.oncopy=function(){alert("复制成功！撰文不易，转载请务必保留原文链接，谢谢合作！");}
</script>

	
	<!--背景图：https://www.npc.ink/2927.html-->
<div class="single-bj" style="background-image: url(<?php
					$full_image_url = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full');
					echo $full_image_url[0];?>); ">
	<div class="single-main-header">
		<div class="single-main-txt">
		
<!--文章标题-->
		<div class="single-title"><?php the_title(); ?></div>
		
		<!--博文附加内容-->
			<div class="single-meta">  
							
				<!--时间：--><?php the_time( 'Y.m.d' ); ?>
				•
				<!--阅览次数-->阅读：<?php post_views('', ''); ?>
				•
				<!--类别：--><?php the_category(','); ?>
				
				<!--功能菜单--><?php edit_post_link('• <i class="fas fa-eraser"></i>', '', '' ); ?>
			</div>
		
	</div>
	</div>
</div>

<!--博文外框-->
<div class="single-blog">
	<div class="single-blog-box">

<!--博文摘要-->
	<div class="single-abstract effects">
		<?php
echo wp_trim_words( get_the_excerpt(), 50 ); // 文章摘要
?>
		</div>
		
<!--博文内容-->

	<div id="content" class="single-content">
		<?php while( have_posts() ): the_post(); $p_id = get_the_ID(); ?>
	<?php the_content(); ?>
	<?php endwhile; ?>
	
		</div>
		
		



<!--博文标签、编辑日期-->
	<div class="single-blog-meat">
		
		<!--博文标签-->
			<div class="single-tag effects">
				 <?php echo get_the_tag_list('标签:'.' ',',');?>
			</div>
		
		<!--最后更新时间：https://www.npc.ink/4421.html-->
		<div class="single-time">
			<?php echo '发表于 '.timeago( get_gmt_from_date(get_the_time('Y-m-d G:i:s')) ); ?>
		</div>
		
	</div>
<!--三个选项框-->
		
	
		
		<div class="single-meat">
			<button class="single-block effects">返回文章列表</button>
			
			<button class="single-block effects">
				<i class="fas fa-qrcode"></i>&nbsp;&nbsp;二维码
			</button>
			
			<button class="single-block effects"><i class="fas fa-gift"></i>&nbsp;&nbsp;打赏</button>
		
		</div>
		
	
		
		
		
	
	<!--上下文标题、链接：https://www.npc.ink/2929.html-->
	<div class="single-more">
		<!--限制标题字数;https://www.npc.ink/4514.html-->	
			<div class="post-PrevNext">
			<?php
			$current_category = get_the_category();//获取当前文章所属分类ID
			$prev_post = get_previous_post($current_category,'');//与当前文章同分类的上一篇文章
			$next_post = get_next_post($current_category,'');//与当前文章同分类的下一篇文章
			?>
	
			<div class="previous_post_link">
				<?php if (!empty( $prev_post )): ?>
					<a  href="<?php echo get_permalink( $prev_post->ID ); ?>">
						<span>上一篇:</span><br><?php echo $prev_post->post_title; ?>
					</a>	
				<?php endif; ?>
			</div>
				
			<div class="next_post_link">
			<?php if (!empty( $next_post )): ?>
				<a href="<?php echo get_permalink( $next_post->ID ); ?>">
					 <span>下一篇:</span><br><?php echo $next_post->post_title; ?>
				</a>
			<?php endif; ?>
			</div>
				
			</div>
		</div>
	
<!--评论盒子-->
	<div class="single-comments">
<!--评论,评论模板：comments.php-->
				<?php comments_template(); ?>
	</div>
	</div>
</div>

<?php get_footer(); ?>